import networkx as nx
import osmnx as ox
import pyrosm
from pyrosm import OSM, get_data
import osmnx as ox

# Initialize the reader
osm = OSM(get_data("helsinki_pbf"))

# Get all walkable roads and the nodes
nodes, edges = osm.get_network(nodes=True)

# Check first rows in the edge
edges.head()
fp = get_data("test_pbf")



from pyrosm import get_data
# # Download data for the city of Helsinki
# fp = get_data("Helsinki")
# print(fp)

from pyrosm import OSM
fp = get_data("test_pbf")

# Initialize the OSM parser object
osm = OSM(fp)

drive_net = osm.get_network(network_type="driving")
# drive_net.plot()
drive_net.head(2)

# fp = 'shanxi-latest.osm.pbf'
# osm = pyrosm.OSM(fp)

# drive_net = osm.get_network(network_type="driving")
# drive_net.plot()

# ox.__version__
#
# # download/model a street network for some city then visualize it
# G = ox.graph.graph_from_place("Piedmont, California, USA", network_type="drive")
# fig, ax = ox.plot.plot_graph(G)